<div class="comment-box">
  <div class="comment-title">
    <i class="fa fa-comments" aria-hidden="true"></i>
    {empty name="current_user"}
      用户评论（<a class="cmt-login" href="{:url('login/login')}">请登录评论</a>）
    {else /}
      用户评论（{$comment_res->total()}条）
    {/empty}
  </div>
  {empty name="current_user"}
    <form class="form-horizontal mb-20" role="form" id="comment_form" action="{:url('comment/create')}" method="post">
      <input type="hidden" name="belongs_type" id="belongs_type" value="Article">
      <input type="hidden" name="belongs_id" id="belongs_id" value="{$article.id}">
      <input type="hidden" name="parent_id" id="parent_id" value="0">
    </form>
  {else /}
    <form class="form-horizontal mb-20" role="form" id="comment_form" action="{:url('comment/create')}" method="post">
      <div class="form-group">
        <input type="hidden" name="belongs_type" id="belongs_type" value="Article">
        <input type="hidden" name="belongs_id" id="belongs_id" value="{$article.id}">
        <input type="hidden" name="parent_id" id="parent_id" value="0">
        <textarea id="content" name="content" class="form-control" rows="5" placeholder="鼓励一下作者吧……"></textarea>
      </div>
      <div class="form-group no-margin no-padding">
        <button type="submit" class="btn btn-theme pull-right rounded">提交</button>
      </div>
    </form>
  {/empty}
  <ul class="media-list comment-list" id="comment-box">
    {include file="comment/ajax_list" /}
  </ul><!-- comment-list -->
  <div class="row">
    <div class="col-xs-12 text-center mb-20">
      <?php if($comment_res->totalPage() > 1): ?>
        <div class="hide" id="fall-loading">
          <p class="text-center"><img src="{$site_root}/static/index/images/loader/general/2.gif" alt="..."/> 正在加载中……</p>
        </div>
        <div class="" id="paginate-btn">
          <a class="btn btn-sm btn-theme" onclick="return waterFallComment(this);">更多评论</a>
        </div>
      <?php endif; ?>
    </div>
  </div>

  <!-- comment reply form-->
  <div class="media hidden" id="media-reply">
    <form class="form-horizontal mb-20" role="form" id="reply_form" action="{:url('comment/create')}" method="post">
      <div class="form-group">
        <input type="hidden" name="belongs_type" id="belongs_type" value="Article">
        <input type="hidden" name="belongs_id" id="belongs_id" value="{$article.id}">
        <input type="hidden" name="parent_id" id="parent_id" value="0">
        <textarea id="content" name="content" class="form-control" rows="5" placeholder="回复内容……"></textarea>
      </div>
      <div class="form-group no-margin no-padding">
        <button type="submit" class="btn btn-sm btn-primary pull-right rounded">提交</button>
        <a href="javascript:void(0);" onclick="hiddenReplyCommentModal();" class="btn btn-sm btn-default pull-right rounded mr-10">取消</a>
      </div>
    </form>
  </div>
</div>